

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;

import eu.hansolo.steelseries.gauges.Radial;

//import eu.hansolo.steelseries.;
import java.awt.BorderLayout;
import java.awt.Color;

import javax.swing.JPanel;

/**
 * This code was edited or generated using CloudGarden's Jigloo
 * SWT/Swing GUI Builder, which is free for non-commercial
 * use. If Jigloo is being used commercially (ie, by a corporation,
 * company or business for any purpose whatever) then you
 * should purchase a license for each developer using Jigloo.
 * Please visit www.cloudgarden.com for details.
 * Use of Jigloo implies acceptance of these licensing terms.
 * A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
 * THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
 * LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
 */
public class Display1 extends javax.swing.JFrame {
	private JPanel jPanel1;
//	private double dd;

	Radial instSOG = new Radial();
	Radial instAWS = new Radial();
	Radial instTWS = new Radial();

	/**
	 * Auto-generated main method to display this JFrame
	 */
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				Display1 inst = new Display1();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
				inst.setWert(6.9);
			}
		});
	}

	public Display1(){
		super();
		initGUI();
	}

	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				jPanel1 = new JPanel();
				getContentPane().add(jPanel1, BorderLayout.CENTER);
				
			}
			pack();
			this.setSize(1024,600);

			instSOG.setMinValue(0.0);
			instSOG.setMaxValue(10.0);
			instSOG.setValueCoupled(false);
			instSOG.setLcdDecimals(1);
			instSOG.setLcdUnitString("ktn");
			instSOG.setLcdUnitStringVisible(true);
			instSOG.setTitle("SOG");
			instSOG.setUnitString("ktn");			
			instSOG.setMaxMeasuredValueVisible(true);
			instSOG.setMinMeasuredValueVisible(true);
			instSOG.setScaleDividerPower(0);

			instSOG.setThreshold(7.0);
			instSOG.setThresholdVisible(true);
			
			instAWS.setMinValue(0.0);
			instAWS.setMaxValue(30.0);
			instAWS.setValueCoupled(false);
			instAWS.setLcdDecimals(1);
			instAWS.setTitle("AWS");
			instAWS.setUnitString("ktn");
			
			instTWS.setMinValue(0.0);
			instTWS.setMaxValue(30.0);
			instTWS.setValueCoupled(false);
			instTWS.setLcdDecimals(1);
			instTWS.setTitle("TWS");
			instTWS.setUnitString("ktn");
			instTWS.setTrackStart(5);
			instTWS.setTrackSection(20);
			instTWS.setTrackStop(30);
			instTWS.setTrackStartColor(new Color(100));
			instTWS.setTrackVisible(true);
			

			instSOG.setPreferredSize(new java.awt.Dimension(250, 250));
			instAWS.setPreferredSize(new java.awt.Dimension(250, 250));
			instTWS.setPreferredSize(new java.awt.Dimension(250, 250));
			
			jPanel1.add(instSOG);
			jPanel1.add(instAWS);
			jPanel1.add(instTWS);
		} catch (Exception e) {
			//add your error handling code here
			e.printStackTrace();
		}
	}
	
	public void setWert (double f){
		Double cog = f;
		instSOG.setValueAnimated(cog);
		//System.out.println("Value set to  : "+instSOG.getValue());
	}
	public void setWerte (double f, Double g, Double h){
		Double cog = f;
		Double tws = g;
		Double aws = h;
		instSOG.setValueAnimated(cog);
		instSOG.setLcdValue(cog);
		instAWS.setValueAnimated(aws);
		instAWS.setLcdValue(aws);
		instTWS.setValueAnimated(tws);
		instTWS.setLcdValue(tws);
		//System.out.println("Value set to  : "+instSOG.getValue());
	}
}

